<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <link rel="shortcut icon" href="../static/img/logo.png" th:href="@{/img/logo.png}" type="image/x-icon"/>

</head>
<body>
<div th:fragment="bbsheadnav(path)">
    <!--head-->
    <div class="container-fluid bbsheader">
        <div class="row">
            <!--        导航-->
            <div class="col-md-7 leftnav">
                <img class="img-rounded bbslogo" th:src="@{/img/logo.png}" alt="load jpg failure">
                <div class="bbstabs">
                    <ul class="nav nav-tabs">
                        <li th:class="${path =='index'}?'nav-link active':'nav-link'"><a href="/index">首页</a></li>
                        <li th:class="${path =='disease'}?'active':''"><a href="/disease/index">疾病</a></li>
                        <li th:class="${path =='selfchecking'}?'nav-link active':'nav-link'"><a href="/selfchecking/index">测评</a></li>
                        <li th:class="${path =='ask'}?'nav-link active':'nav-link'"><a href="/ask">问答</a></li>
                        <li th:class="${path =='article'}?'nav-link active':'nav-link'"><a href="/article">论坛</a></li>
                        <li class="dropdown">
                            <a class="dropdown-toggle" data-toggle="dropdown" role="button">更多<span
                                    class="caret"></span></a>
                            <ul class="dropdown-menu bbsmoremenu">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another</a></li>
                                <li><a href="#">Somethi</a></li>
                                <li><a href="#">Separat</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
            <!--        搜索-->
            <div class="col-md-2  midnav">
                <div class="row reserchgroup">
                    <input type="text" class="col-md-10" placeholder="Search for...">
                    <button class="col-md-2" type="button">GO</button>
                </div>
            </div>
            <!--        用户登录态-->
            <div class="col-md-2 rightnav">
                        <div th:if="${session.get('user')==null}">
                            <ul class="list-unstyled list-inline">
                                <li>
                                    <div class="login-div" onclick="loginmodal()">
                                        <a>
                                            <span style="color: #26A027" class="glyphicon glyphicon-lock"></span>
                                            <span> 登录/注册 </span>
                                        </a>
                                    </div>
                                </li>
                            </ul>
                        </div>
                <div th:unless="${session.get('user')==null}">
                    <div class="dropdown">
                        <img src="../static/img/login/male.png" th:src="@{${session.get('user').img}}" alt="头像" class="img-circle dropdown-toggle"
                             data-toggle="dropdown"
                             onmouseenter="avtorliston()" onmouseleave="avtorlistoff()" id="avtorimg">
                        <ul class="dropdown-menu avtorlist" onmouseleave="avtorlistoff()">
                            <li><b th:text="${session.get('user').name}">甲甲子</b> <b th:if="${session.get('user').type==2}" class="label label-warning">医生</b></li>
                            <li class="divider"></li>
                            <li><a th:href="@{'/user/'+${session.get('user').id}}">个人中心</a></li>
                            <li><a th:href="@{/article/index}">内容管理</a></li>
                            <li><a href="#">其他</a></li>
                            <li class="divider"></li>
                            <li><a th:href="@{/loginout}">退出</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div th:fragment="bbsloginform">
    <!--login-->
    <div class="container-fluid" id="logindiv" style="display: none">
        <div>
            <button type="button" class="cancellogin" onclick="closelogin()">X</button>
        </div>
        <div class="row loginrow">
            <div class="col-md-6" id="leftpart">
                <div>
                    <canvas id="snowfall"></canvas>
                </div>
            </div>
            <div class="col-md-6">
                <form id="login_form">
                    <div class="loginhead">
                        <h3 class="form-title">Login to your account</h3>
                    </div>
                    <div class="logininput">
                        <input type="text" placeholder="用户名" id="lusername"  maxlength="20" required/>
                    </div>
                    <div class="logininput">
                        <input type="password" placeholder="密码" id="password" maxlength="18"/>
                    </div>
                    <div class="logininput" id="rpassdiv" style="display: none">
                        <input type="password" placeholder="确认密码" id="rpassword"
                               maxlength="18" required/>
                    </div>
                    <div class="logintip" id="logintipdiv">
                        <div id="loginwaring"></div>
                        <a href="#">忘记密码</a>
                    </div>
                    <div class="registtip" id="registtipdiv" style="display:none;">
                        <div id="registwaring">xxxxxx</div>
                    </div>
                    <div class="loginbutton" id="loginbtndiv">
                        <input type="button" id="loginbtn" value="登录" onclick="tologin()"/>
                    </div>
                    <div class="loginbutton" id="registerdiv" style="display: none">
                        <input type="button" id="registerbtn" value="注册" onclick="toregister()"/>
                    </div>

                    <div class="loginbottom" id="bottomdiv">
                        <a onclick="register()">注册</a>
                        <img th:src="@{/img/login/qq.png}" class="img-circle">
                        <img th:src="@{/img/login/wechat.png}" class="img-circle">
                        <img th:src="@{/img/login/in.png}" lass="img-circle">
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>
